package com.zjitc.dao.impl;

import cn.hutool.core.io.IoUtil;
import com.zjitc.dao.UserDao;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;

/**
 * @author 何景航
 * @date 2025/9/26 14:20
 */
@Repository("Daoooo")
public class UserDaoImpl implements UserDao{
    @Override
    public List<String> findAll() {
        //1.加载并读取文件
        InputStream in = this.getClass().getClassLoader().getResourceAsStream("user.txt");
        ArrayList<String> lines = IoUtil.readLines(in, StandardCharsets.UTF_8, new ArrayList<>());
        return lines;
    }
}
